package cn.xzqwjw.taskmanager.security.handler;

import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.logout.LogoutHandler;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author rush
 */
public class CustomLogoutHandler implements LogoutHandler {

  @Override
  public void logout(HttpServletRequest request,
                     HttpServletResponse response,
                     Authentication authentication) {
    // 这里可以实现具体想要的业务。比如记录用户下线退出时间、IP 等等。
    // User user = (User) authentication.getPrincipal();
    // String username = user.getUsername();
  }

}
